def game():
    print("when it's really counts! MeTaBo.")
    print('1即装弹，2即防御，3即枪，按4退出。')
    answer = input()
    return answer


def add_a_bullet(is_pl):
    global pl_g_bullet_num, pr_g_bullet_num
    if is_pl:
        pl_g_bullet_num += 1
    else:
        pr_g_bullet_num += 1


def use_bullet(is_pl, num=1):
    global player_b, program_b, pl_g_bullet_num, pr_g_bullet_num
    if is_pl:
        pl_g_bullet_num -= num
        player_b = num
    else:
        pr_g_bullet_num -= num
        program_b = num


exit_game = False
player_b = 0
program_b = 0
pl_is_defence = False
pr_is_defence = False
pl_g_bullet_num = 0
pr_g_bullet_num = 0

while not exit_game:
    ans = game()
    if ans == '4':
        exit_game = True
    else:
        if ans == '1':
            pl_is_defence = False
            add_a_bullet(True)
        elif ans == '2':
            pl_is_defence = True
        elif ans == '3':
            pl_is_defence = False
            use_bullet(True)

